package com.jhh.pay.channel.pojo;

import java.util.HashMap;
import java.util.Map;

import lombok.Data;

@Data
public class ResponseBean {
	
	private TradeState state;
	
	private String code;
	
	private String msg;
	
	private Map<String, String> extension;
	
	public static ResponseBean getDefault() {
		ResponseBean res = new ResponseBean();
		res.setCode("200");
		res.setMsg("操作成功");
		return res;
	}
	
	public static ResponseBean SUCCESS_RESPONSE() {
		ResponseBean res = new ResponseBean();
		res.setState(TradeState.SUCCESS);
		res.setCode("200");
		res.setMsg("操作成功");
		res.extension = new HashMap<>();
		return res;
	}
	
	public static ResponseBean FAIL_RESPONSE() {
		ResponseBean res = new ResponseBean();
		res.setState(TradeState.ERROR);
		res.setCode("500");
		res.setMsg("操作失败");
		res.extension = new HashMap<>();
		return res;
	}

	public static ResponseBean WAIT_RESPONSE() {
		ResponseBean res = new ResponseBean();
		res.setState(TradeState.PROGRESSING);
		res.setCode("600");
		res.setMsg("处理中");
		res.extension = new HashMap<>();
		return res;
	}

	public static ResponseBean SYSERROR_RESPONSE() {
		ResponseBean res = new ResponseBean();
		res.setState(TradeState.ERROR);
		res.setCode("9999");
		res.setMsg("系统异常");
		res.extension = new HashMap<>();
		return res;
	}

}
